<%--
  Created by IntelliJ IDEA.
  User: XWB
  Date: 2019/12/7
  Time: 16:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>添加通讯组</title>
    <link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" language="JavaScript1.2" src="${pageContext.request.contextPath}/js/stm31.js"></script>
    <script language="javascript">
        /*function selectAllByChk(chk,checkbox) {
            var size = checkbox.length;
            if(size == null)
                checkbox.checked =chk.checked;
            else{
                for (var i = 0; i < checkbox.length; i++) {
                    checkbox[i].checked =chk.checked;
                }
            }
        }*/
        function deleteGroup(){
            var result="";
            var count=0;
            $(".checkB").each(function(){
                if($(this).is(':checked')){
                    result+=$(this).val()+",";
                    count++;
                }else{}
            });
            if(!confirm("确定删除这"+count+"个通讯组吗?")){
                return true;
            }
            window.location.href= "${pageContext.request.contextPath}/newsReport/deleteGroup.do?tag="+result;
        }

        function openwin(url)
        {
            window.open (url, "look", "height=300, width=500, toolbar=no, menubar=no, scrollbars=yes,resizable=no, location=no, status=no");

        }
        /*function del()
        {
            var str=confirm('确认删除通讯组吗？');
            if(str==true)
            {
                window.location.href='';
                return true;
            }else{
                return false;
            }
        }*/
    </script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td width="2%" valign="middle" background="${pageContext.request.contextPath}/images/bg_03.gif">&nbsp;</td>
        <td width="2%" valign="middle" background="${pageContext.request.contextPath}/images/bg_03.gif"><img src="${pageContext.request.contextPath}/images/main_28.gif" width="9" height="9" align="absmiddle"></td>
        <td height="30" valign="middle" background="${pageContext.request.contextPath}/images/bg_03.gif"><font color="#FFFFFF">通讯组管理</font></td>
    </tr>
</table>
<br>
<form method="post" action="${pageContext.request.contextPath}/newsReport/findDpGroupByName.do">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="table01">
    <tr>
        <td height="30" colspan="2" class="td_02"><SPAN class=td_title>通讯组查询</SPAN></td>
    </tr>
    <tr>
        <td width="10%" class="td_02">通讯组名称</td>
        <td width="84%" height="30" class="td_02">
            <input name="name" type="text" class="input" style="width:85% ">
            <input name="Submit22" type="submit" class="buttonface02" value="  查询  ">    </td>
    </tr>
</table>
</form>
<br>
<table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td class="td_page">      <div align="right">
            <input name="Submit2" type="button" class="buttonface02" value="新建通讯组" onClick="openwin('${pageContext.request.contextPath}/jsp/address_list/addGroup.jsp')">

            <input name="Submit" type="button" class="buttonface02" value="删除所选通讯组" onClick="deleteGroup()">
        </div></td>
    </tr>
</table>
<table width="95%"  border="0" cellpadding="0" cellspacing="0" class="table02" align="center">
    <tr>
        <td width="37%" align="right"><div align="left"></div></td>
        <td width="63%" height="30" align="right">
            <img src="${pageContext.request.contextPath}/images/1.gif" width="4" height="5" align="absmiddle">
            <a href="${pageContext.request.contextPath}/newsReport/newsReportManager.do?pageNum=1">首页</a>
            <img src="${pageContext.request.contextPath}/images/2.gif" width="3" height="5" align="absmiddle">
            <a href="${pageContext.request.contextPath}/newsReport/newsReportManager.do?pageNum=${(page.pageNum<=1)?page.pageNum:(page.pageNum-1)}">上一页</a>　
            <img src="${pageContext.request.contextPath}/images/2-2.gif" width="3" height="5" align="absmiddle">
            <a href="${pageContext.request.contextPath}/newsReport/newsReportManager.do?pageNum=${(page.pageNum>=page.totalPages)?page.pageNum:(page.pageNum+1)}">下一页</a>　
            　
            <img src="${pageContext.request.contextPath}/images/3.gif" width="4" height="5" align="absmiddle">
            <a href="${pageContext.request.contextPath}/newsReport/newsReportManager.do?pageNum=${page.totalPages}">末页</a>　　
            共${page.pageNum}/${page.totalPages} 页 ${page.totalRows} 条记录</td>
    </tr>
</table>

<table width="95%" border="0" align="center" cellpadding="2" cellspacing="0" class="table01">
    <tr>
        <td width="15%" class="td_top">
            <%--<input name="chk" type="checkbox" id="chk" onClick="selectAllByChk(chk,checkbox)" value="">--%></td>
        <td class="td_top">通讯组名称</td>
        <td class="td_top">通讯组描述</td>
        <td width="15%" class="td_top">查看成员</td>
        <td width="10%" class="td_top">修改</td>
    </tr>
    <c:forEach items="${page.datas}" var="data">
        <tr>
            <td class="td_02"><input type="checkbox" class="checkB" name="checkB" value="${data.id}"></td>
            <td class="td_02">${data.name}</td>
            <td class="td_02">${data.content}</td>
            <td class="td_02"><a href="${pageContext.request.contextPath}/newsReport/findDepartment.do?pid=${data.id}">查看成员</a></td>
            <td class="td_02"><a href="#" onClick="openwin('${pageContext.request.contextPath}/newsReport/findDpGroupById.do?id=${data.id}')">修改</a></td>
        </tr>
    </c:forEach>
</table>

</body>
</html>

